(function (win, ysp) {
  ysp.runtime.Model.extendLoadingModel({
    getData_control4_lZz3Hc: function (elem) {
      var trs = $(elem).find('tr');var head = $(trs[0]).find('th');var headerIndex = {};$(head).each(function (i, v) {
        if (v.textContent.indexOf('标题') > -1) {
          headerIndex.title = i;
        }
        if (!headerIndex.time) {
          if (v.textContent.indexOf('时间') > -1) {
            headerIndex.time = i;
          }
        } // if (!headerIndex.other) {
        //   if (v.textContent.indexOf('发起人') > -1) {
        //     headerIndex.other = i;
        //   }
        // }
      });var datalist = trs.slice(1);var newList = [];function listObj(obj) {
        this.title = obj.title;
        this.index = obj.index;this.time = obj.time;
      }if (datalist.length > 0) {
        datalist.forEach((v, k) => {
          var tds = $(v).find('td');var obj = {};$(tds).each(function (i, val) {
            if (i == headerIndex.title) {
              var $a = $($(val).find('a'));obj.title = $a.text();obj.index = i;
            }if (i == headerIndex.time) {
              var reg = /(\d{4}-\d{2}-\d{2})/;var time = $(val)[0].textContent.match(reg)[1];obj.time = time;
            }
          });newList.push(new listObj(obj));
        });
      } else {
        console.log('暂无数据');
      }return newList;
    },
    doAction_uiControl4_Xt1TdF: function (data, elem) {
      var evet = data.eventType;if (evet === 'click') {
        var doc = elem.ownerDocument;var win = window.top;var trs = $(elem).find('tr').slice(1);var indexObj = data.customData;var target;$(trs).each(function (i, v) {
          if (indexObj.li == i) {
            $(v).find('td').slice(0).forEach((td, k) => {
              if (k == indexObj.index) {
                target = td;
              }
            });
          }
        });debugger;while (true) {
          if (target.tagName.toLowerCase().indexOf('a') > -1) {
            break;
          } else {
            target = target.children[0];
          }
        }target.click();
      }
    },
    getTemplate_uiControl4_Xt1TdF: function () {
      var selfTemplate = 'module.exports = React.createClass({\n  onClick (e){\n    var handler=this.props.customHandler;\n    var index = e.currentTarget.dataset.index;\n  var li = e.currentTarget.dataset.li;\n    if(handler){\n      handler({\n        eventType:\'click\',\n        customData: {index:index,li:li}\n      })\n    }\n  },\n  render: function() {\n    var data =this.props.customData;\n    if(!data){\n      data ={\n    val: \'\u76EE\u524D\u8FD8\u6CA1\u6709\u60A8\u53EF\u67E5\u9605\u7684\u6587\u6863\uFF01\'\n  };\n    }\n   var dl;\n    if(!Array.isArray(data)){\n      dl = <div>{data.val}</div>\n    }else{\n    \t dl=data.map((li,k)=>{\n        return (\n        \t<li onClick={this.onClick} data-index={li.index} data-li={k}>\n            <div className=\'banner\'>\n              <h5>{li.title}</h5>\n              <p>\n                <span>{li.time}</span>\t\n              </p>\n            </div>\n          </li>\n        )\n      })\n    }\n    return (\n      <div>\n      \t<ul className="content-ul">\n        \t{dl}\n        </ul>\n      </div>\n    )\n  }\n});';
      return '\'use strict\';\n\nmodule.exports = React.createClass({\n  displayName: \'exports\',\n  onClick: function onClick(e) {\n    var handler = this.props.customHandler;\n    var index = e.currentTarget.dataset.index;\n    var li = e.currentTarget.dataset.li;\n    if (handler) {\n      handler({\n        eventType: \'click\',\n        customData: { index: index, li: li }\n      });\n    }\n  },\n\n  render: function render() {\n    var _this = this;\n\n    var data = this.props.customData;\n    if (!data) {\n      data = {\n        val: \'\u76EE\u524D\u8FD8\u6CA1\u6709\u60A8\u53EF\u67E5\u9605\u7684\u6587\u6863\uFF01\'\n      };\n    }\n    var dl;\n    if (!Array.isArray(data)) {\n      dl = React.createElement(\n        \'div\',\n        null,\n        data.val\n      );\n    } else {\n      dl = data.map(function (li, k) {\n        return React.createElement(\n          \'li\',\n          { onClick: _this.onClick, \'data-index\': li.index, \'data-li\': k },\n          React.createElement(\n            \'div\',\n            { className: \'banner\' },\n            React.createElement(\n              \'h5\',\n              null,\n              li.title\n            ),\n            React.createElement(\n              \'p\',\n              null,\n              React.createElement(\n                \'span\',\n                null,\n                li.time\n              )\n            )\n          )\n        );\n      });\n    }\n    return React.createElement(\n      \'div\',\n      null,\n      React.createElement(\n        \'ul\',\n        { className: \'content-ul\' },\n        dl\n      )\n    );\n  }\n});';
    },
    getData_control5_g1vSrA: function (elem) {},
    doAction_uiControl5_alIUW7: function (data, elem) {},
    getTemplate_uiControl5_alIUW7: function () {
      var selfTemplate = 'var Header = require(\'ysp-custom-components\').Header;\nmodule.exports = React.createClass({\n  render: function() {\n    var data={\n      title:\'\u7535\u5B50\u516C\u544A\'\n    }\n    return (\n      <div>\n       <Header data={data}/>\n      </div>\n    )\n  }\n});';
      return '\'use strict\';\n\nvar Header = require(\'ysp-custom-components\').Header;\nmodule.exports = React.createClass({\n  displayName: \'exports\',\n\n  render: function render() {\n    var data = {\n      title: \'\u7535\u5B50\u516C\u544A\'\n    };\n    return React.createElement(\n      \'div\',\n      null,\n      React.createElement(Header, { data: data })\n    );\n  }\n});';
    },
    getData_control8_pUubRK: function (elem) {
      var lis = elem.children;var pre = $(lis[1]).attr('class');var next = $(lis[3]).attr('class');if (!pre) {
        return '';
      }var obj = { pre: pre, next: next };return obj;
    },
    doAction_uiControl8_cm1Fbo: function (data, elem) {
      var isNext = data.customData;if (data.eventType == 'click') {
        var children = elem.children;if (isNext == 'next') {
          children[3].click();
        } else if (isNext == 'pre') {
          children[1].click();
        }
      }
    },
    getTemplate_uiControl8_cm1Fbo: function () {
      var selfTemplate = "module.exports = React.createClass({\n  onClick (e) {\n    var target = e.target;\n    var classname = target.getAttribute('class');\n    var handler = this.props.customHandler;\n    var flag = classname.indexOf('disable')\n    var isNext = classname.split(' ')[0];\n    debugger\n    if((flag>-1)){\n      return false;\n    }\n    if(handler){\n     \n      handler({\n        eventType: 'click',\n        customData: isNext\n      })\n    }\n},\n  componentDidMount (){\n    \n      window.scrollTo(0,0)\n},\n    componentDidUpdate (){\n    \n      window.scrollTo(0,0)\n},\n  render: function() {\n  \n    var dataObj = this.props.customData;\n    return (\n      <div>\n       <div className='foot'>\n        \t<span className={dataObj.pre.indexOf('disable')>-1?\"pre btn-arrow disable\":\"pre btn-arrow\"}\n onClick={this.onClick}>\u4E0A\u4E00\u9875</span>\n        \t<span  className={dataObj.next.indexOf('disable')>-1?\"next btn-arrow disable\":\"next btn-arrow\"}\n onClick={this.onClick}>\u4E0B\u4E00\u9875</span>\n        </div>\n      </div>\n    )\n  }\n});";
      return '\'use strict\';\n\nmodule.exports = React.createClass({\n  displayName: \'exports\',\n  onClick: function onClick(e) {\n    var target = e.target;\n    var classname = target.getAttribute(\'class\');\n    var handler = this.props.customHandler;\n    var flag = classname.indexOf(\'disable\');\n    var isNext = classname.split(\' \')[0];\n    debugger;\n    if (flag > -1) {\n      return false;\n    }\n    if (handler) {\n\n      handler({\n        eventType: \'click\',\n        customData: isNext\n      });\n    }\n  },\n  componentDidMount: function componentDidMount() {\n\n    window.scrollTo(0, 0);\n  },\n  componentDidUpdate: function componentDidUpdate() {\n\n    window.scrollTo(0, 0);\n  },\n\n  render: function render() {\n\n    var dataObj = this.props.customData;\n    return React.createElement(\n      \'div\',\n      null,\n      React.createElement(\n        \'div\',\n        { className: \'foot\' },\n        React.createElement(\n          \'span\',\n          { className: dataObj.pre.indexOf(\'disable\') > -1 ? "pre btn-arrow disable" : "pre btn-arrow",\n            onClick: this.onClick },\n          \'\\u4E0A\\u4E00\\u9875\'\n        ),\n        React.createElement(\n          \'span\',\n          { className: dataObj.next.indexOf(\'disable\') > -1 ? "next btn-arrow disable" : "next btn-arrow",\n            onClick: this.onClick },\n          \'\\u4E0B\\u4E00\\u9875\'\n        )\n      )\n    );\n  }\n});';
    }
  });
})(window, ysp);